Skip to content

Comments

Audit Symbols#152624

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
camsteffen:symbols-audit
Feb 21, 2026
Merged

Audit Symbols#152624
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
camsteffen:symbols-audit

Conversation

@camsteffen
Copy link
Contributor

@camsteffen camsteffen commented Feb 14, 2026

View all comments

Remove unused symbols and hoist some symbols to Clippy.

@rustbot
Copy link
Collaborator

rustbot commented Feb 14, 2026

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Feb 14, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 14, 2026

r? @adwinwhite

rustbot has assigned @adwinwhite.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 68 candidates
  • Random selection from 15 candidates

new_v1,
new_v1_formatted,
next,
niko,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@samueltardieu samueltardieu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the removal of the slice duplicate, you can r=me for the Clippy part.

View changes since this review

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bjorn3
Copy link
Member

bjorn3 commented Feb 14, 2026

Some of these symbols were added as a perf optimization to avoid having to allocate for identifiers that are commonly used. And pre-interned symbols are represented with less bytes in the crate metadata.

BTreeEntry,
BTreeMap,
BTreeSet,
BinaryHeap,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were added in camsteffen@eada4d1 They are still diagnostics items.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since then, #138682 gave Clippy the ability to define their own Symbols. Many diagnostic items exist only for Clippy, so I figured only Clippy benefits from the pre-defined Symbols.

SymbolIntern,
Sync,
SyncUnsafeCell,
T,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very common identifier.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather try to pre-intern all ASCII letters a-zA-Z, similarly to sym::integer, and see if it makes any difference. Many of them are common.
(Not as a part of this PR.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I wonder if there should be a special place for pre-interned symbols that are not sym::_ consts, just to ensure that silly people like me won't spend time auditing them.

@Mark-Simulacrum
Copy link
Member

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Feb 14, 2026
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 14, 2026
@camsteffen
Copy link
Contributor Author

Some of these symbols were added as a perf optimization to avoid having to allocate for identifiers that are commonly used. And pre-interned symbols are represented with less bytes in the crate metadata.

Hmm, I didn't realize that. I can look for names that are common and add those back. So IIUC we may want to keep as_str since that is a common method name, but not necessarily keep String since most crates don't define a String.

I'll wait for the perf run for now.

@bjorn3
Copy link
Member

bjorn3 commented Feb 15, 2026

but not necessarily keep String since most crates don't define a String

But they do reference it. Each crate has an independent symbol interner. There is no cross-crate importing of symbols.

@adwinwhite
Copy link
Contributor

adwinwhite commented Feb 15, 2026

@bjorn3 I'm not familiar with this part and won't have much time looking into it either. Would you like to take over the review since you're already reviewing it?

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 15, 2026

☀️ Try build successful (CI)
Build commit: 6f9923e (6f9923e5e0a6b621aa74d57d64d3ff834b60a8cc, parent: a33907a7a5381473eec8bcfa0c56e05a856a911c)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (6f9923e): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.5%, -0.2%] 3
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 3.0%, secondary 0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.0% [3.0%, 3.0%] 1
Regressions ❌
(secondary)
2.3% [1.3%, 2.8%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-6.8% [-6.8%, -6.8%] 1
All ❌✅ (primary) 3.0% [3.0%, 3.0%] 1

Cycles

Results (secondary -3.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.9% [-3.9%, -3.9%] 1
All ❌✅ (primary) - - 0

Binary size

Results (primary -0.0%, secondary -0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
-0.0% [-0.0%, -0.0%] 4
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 14
All ❌✅ (primary) -0.0% [-0.0%, -0.0%] 4

Bootstrap: 483.617s -> 479.802s (-0.79%)
Artifact size: 397.94 MiB -> 397.91 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 15, 2026
@rust-bors

This comment has been minimized.

@camsteffen
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 20, 2026
@petrochenkov
Copy link
Contributor

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 20, 2026

📌 Commit 0f9b166 has been approved by petrochenkov

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 20, 2026
@JonathanBrouwer
Copy link
Contributor

JonathanBrouwer commented Feb 20, 2026

@bors p=2
Scheduling this in front of the p=1 iffy job in case the rollup fails

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Feb 20, 2026
Audit Symbols

*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/152624)*

Remove unused symbols and hoist some symbols to Clippy.
@jhpratt
Copy link
Member

jhpratt commented Feb 21, 2026

CI appears stuck (x86_64-gnu-aux specifically)

@bors yield

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 21, 2026

Auto build cancelled. Cancelled workflows:

The next pull request likely to be tested is #152624.

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Feb 21, 2026
Audit Symbols

*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/152624)*

Remove unused symbols and hoist some symbols to Clippy.
@jhpratt
Copy link
Member

jhpratt commented Feb 21, 2026

@bors yield

Let's give a rollup a chance first

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 21, 2026

Auto build cancelled. Cancelled workflows:

The next pull request likely to be tested is #152924.

@rust-bors

This comment has been minimized.

@JonathanBrouwer
Copy link
Contributor

The last job is aarch64-apple which tends to finish if you just give it time, so this time I'm not worried about it being stuck :)

@rust-bors rust-bors bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 21, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 21, 2026

☀️ Test successful - CI
Approved by: petrochenkov
Duration: 3h 31m 2s
Pushing 3fc3732 to main...

@rust-bors rust-bors bot merged commit 3fc3732 into rust-lang:main Feb 21, 2026
12 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 21, 2026
@github-actions
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 1c00e98 (parent) -> 3fc3732 (this PR)

Test differences

Show 1 test diff

1 doctest diff were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 3fc37321c49cb8aed32da426de6145e6d57105da --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-aarch64-linux: 2h 32m -> 1h 54m (-25.0%)
  2. dist-x86_64-apple: 2h 36m -> 2h 8m (-17.8%)
  3. aarch64-msvc-2: 1h 40m -> 1h 52m (+12.6%)
  4. dist-apple-various: 1h 51m -> 1h 38m (-11.8%)
  5. x86_64-msvc-ext1: 2h 3m -> 2h 14m (+9.2%)
  6. aarch64-apple: 3h 44m -> 3h 23m (-9.2%)
  7. x86_64-gnu-llvm-21-1: 1h 13m -> 1h 7m (-8.9%)
  8. dist-aarch64-msvc: 1h 38m -> 1h 46m (+8.4%)
  9. dist-ohos-aarch64: 1h 16m -> 1h 22m (+7.9%)
  10. dist-various-1: 1h 6m -> 1h 11m (+7.1%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3fc3732): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.2%, 0.2%] 1
Regressions ❌
(secondary)
0.2% [0.1%, 0.2%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.5% [-0.7%, -0.3%] 4
All ❌✅ (primary) 0.2% [0.2%, 0.2%] 1

Max RSS (memory usage)

Results (secondary 1.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.9% [0.9%, 3.5%] 8
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (secondary -4.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.1% [-4.1%, -4.1%] 1
All ❌✅ (primary) - - 0

Binary size

Results (primary -0.0%, secondary -0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.0% [-0.0%, -0.0%] 1
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 14
All ❌✅ (primary) -0.0% [-0.0%, -0.0%] 1

Bootstrap: 480.967s -> 482.367s (0.29%)
Artifact size: 397.91 MiB -> 397.92 MiB (0.00%)

@rustbot rustbot added the perf-regression Performance regression. label Feb 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.